/*
 * All rights Reserved, Designed By www.goldbeacon.cn
 * @Title:  demo
 * @Package com.example.demo.domain
 * @author: zoujie
 * @date:   2022/8/1616:28
 * @version V1.0
 * Copyright © 2022 www.goldbeacon.cn. All Rights Reserved.
 * 注意：本内容仅限于湖南金烽信息科技有限公司内部传阅，禁止外泄以及用于其他的商业目
 */
package com.chenzhengrong.demospringboot.domain;


import com.chenzhengrong.demospringboot.annotation.IsMobile;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * @author zoujie
 * @title: User
 * @description: 用户实体类
 * @date 2022/8/16 16:28
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(description="用户实体")
public class User {

    /** ID */
    @ApiModelProperty(value = "用户编号", name = "id", example = "1")
    private Long id;

    /** 姓名 */
    @NotNull(message = "姓名不能为空")
    @ApiModelProperty(value = "用户姓名", name = "name", example = "金烽", required=true)
    private String name;

    /** 年龄 */
    @Min(value = 12, message = "等长大点再来体验！")
    @Max(value = 100, message = "您老生日快乐！")
    @ApiModelProperty(value = "用户年龄", name = "age", example = "18", required = true, notes = "12-100岁的年龄")
    private Integer age;

    /** 手机号 */
    @IsMobile
    @ApiModelProperty(value = "用户手机号", name = "mobile", example = "13800138000", required = true)
    private String mobile;

    /** 账号 */
    @Length(min = 3, max = 20, message = "账号不能为空且长度需要在3和20之间")
    @ApiModelProperty(value = "用户账号", name = "account", example = "admin", required = true, notes = "账号不能为空且长度需要在3和20之间")
    private String account;

    /** 密码 */
    //@NotNull(message = "用户密码不能为空")
    @Length(min = 6, max = 20, message = "密码不能为空且长度需要在6和20之间")
    @ApiModelProperty(value = "用户密码", name = "account", example = "Aa123456", required = true, notes = "密码不能为空且长度需要在6和20之间")
    private String password;
}
